package cn.jetpiece.cloud.system.dp.api.biz;

import cn.jetpiece.cloud.model.page.PageResult;
import cn.jetpiece.cloud.model.response.Result;
import cn.jetpiece.cloud.resource.annotation.annotation.ApiResource;
import cn.jetpiece.cloud.resource.annotation.annotation.ScanResource;
import cn.jetpiece.cloud.system.dp.api.biz.model.params.CreateDpTScopeDataParam;
import cn.jetpiece.cloud.system.dp.api.biz.model.params.UpdateDpTScopeDataParam;
import cn.jetpiece.cloud.system.dp.api.biz.model.query.DpTScopeDataQuery;
import cn.jetpiece.cloud.system.dp.api.biz.model.result.DpTApiResult;
import cn.jetpiece.cloud.system.dp.api.biz.model.result.DpTProjectResult;
import cn.jetpiece.cloud.system.dp.api.biz.model.result.DpTScopeDataResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;

/**
 * dp_t_scope_data
 *
 * @author jetpiece
 * @since 2023-05-18
 */
@Api(tags="dp_t_scope_data")
@ApiResource(name="dp_t_scope_data")
public interface DpTScopeDataApi {

	String API = "/datapipeline/biz/dpTScopeDatas";

	String SCOPE_API = "/datapipeline/biz/dpTScopeDatas/api";

	/**
	 * 新增dp_t_scope_data
	 *
	 * @param param 新增参数
	 * @return 返回结果
	 */
	@ApiOperation(value = "新增dp_t_scope_data")
	@ScanResource(name = "新增dp_t_scope_data", path = API, method = RequestMethod.POST)
	Result<String> add(@RequestBody @Valid CreateDpTScopeDataParam param);

	/**
	 * 修改dp_t_scope_data
	 *
	 * @param param 修改参数
	 * @return 返回结果
	 */
	@ApiOperation(value = "修改dp_t_scope_data")
	@ScanResource(name = "修改dp_t_scope_data", path = API, method = RequestMethod.PUT)
	Result<String> update(@RequestBody @Valid UpdateDpTScopeDataParam param);

	/**
	 * 删除dp_t_scope_data
	 *
	 * @param id 主键
	 * @return 返回结果
	 */
	@ApiOperation(value = "删除dp_t_scope_data")
	@ScanResource(name = "删除dp_t_scope_data", path = API + "/{appKey}/{id}", method = RequestMethod.DELETE)
	Result<String> delete(@PathVariable(name = "appKey") String appKey,@PathVariable(name = "id") Long id);

	/**
	 * 批量删除dp_t_scope_data
	 *
	 * @param ids
	 * @return 返回结果
	 */
	@ApiOperation(value = "批量删除dp_t_scope_data")
	@ScanResource(name = "批量删除dp_t_scope_data", path = API + "/batch-del/{ids}", method = RequestMethod.DELETE)
	Result<String> deleteBatch(@PathVariable("ids") String ids);

	/**
	 * 查询dp_t_scope_data信息
	 *
	 * @param id 主键
	 * @return 返回结果
	 */
	@ApiOperation(value = "查询dp_t_scope_data信息")
	@ScanResource(name = "查询dp_t_scope_data信息", path = API + "/{id}", method = RequestMethod.GET)
	Result<DpTScopeDataResult> get(@PathVariable(name = "id") Long id);

	/**
	 * 分页获取dp_t_scope_data
	 *
	 * @param query 查询条件
	 * @return 返回结果
	 */
	@ApiOperation(value = "分页获取dp_t_scope_data")
	@ScanResource(name = "分页获取dp_t_scope_data", path = API, method = RequestMethod.GET)
	Result<PageResult<DpTProjectResult>> page(@Valid @SpringQueryMap DpTScopeDataQuery query);

	/**
	 * 分页获取dp_t_api_data
	 *
	 * @param query 查询条件
	 * @return 返回结果
	 */
	@ApiOperation(value = "分页获取dp_t_api_data")
	@ScanResource(name = "分页获取dp_t_api_data", path = SCOPE_API, method = RequestMethod.GET)
	Result<PageResult<DpTApiResult>> pageApi(@Valid @SpringQueryMap DpTScopeDataQuery query);

	/**
	 * 新增dp_t_api_data
	 *
	 * @param param 新增参数
	 * @return 返回结果
	 */
	@ApiOperation(value = "新增dp_t_api_data")
	@ScanResource(name = "新增dp_t_api_data", path = SCOPE_API, method = RequestMethod.POST)
	Result<String> addApi(@RequestBody @Valid CreateDpTScopeDataParam param);

	/**
	 * 删除dp_t_api_data
	 *
	 * @param id 主键
	 * @return 返回结果
	 */
	@ApiOperation(value = "删除dp_t_api_data")
	@ScanResource(name = "删除dp_t_api_data", path = SCOPE_API + "/{appKey}/{id}", method = RequestMethod.DELETE)
	Result<String> deleteApi(@PathVariable(name = "appKey") String appKey,@PathVariable(name = "id") Long id);

}
